

package config

import (
    "iip/idgen"
    "iip/iip"
    "iip/webserver"
    "iip/wx"
    "libgo/database/redis"
    "libgo/storage/oss"
)


type Config struct {
    Database  Database         `ini:"Database"`
    DBAccount Database         `ini:"DBAccount"`
    IDGen     idgen.Config     `ini:"IDGen"`
    TMS       iip.Config       `ini:"TMS"`
    Redis     redis.Config     `ini:"Redis"`
    WebServer webserver.Config `ini:"WebServer"`
    Minio     oss.Config       `ini:"Minio"`
    WX        wx.Config        `ini:"Weixin"`
}


func Default() *Config {
    return &Config{
        Database: Database{

            DSN: "root:root@tcp(127.0.0.1:3306)/iip",
        },
        DBAccount: Database{
            DSN: "root:root@tcp(127.0.0.1:3306)/account",
        },
        IDGen:     *idgen.DefaultConfig(),
        TMS:       *iip.DefaultConfig(),
        Redis:     *redis.DefaultConfig(),
        WebServer: *webserver.DefaultConfig(),
        Minio:     *oss.DefaultConfig(),
    }
}

type Database struct {
    DSN string `ini:"dsn" comment:"数据库"`
}
